package jun.management;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.Socket;
import java.net.URL;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;

import android.app.Activity;
import android.app.ActivityGroup;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Color;
import android.media.MediaPlayer;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.Display;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.Toast;


public class GroupActivity extends ActivityGroup{
    /** Called when the activity is first created. */
	
	public static StaticAct Activity = StaticAct.getInstance();

	ArrayList<View> history;
	GroupActivity group;
	
	public void replaceView(View v){
		history.add(v);
		setContentView(v);
	}
	
	public void changeView(View v){
		history.remove(history.size()-1);
		history.add(v);
		setContentView(v);
	}
	
	public void back(){
		if(history.size() > 1){
			history.remove(history.size()-1);
			setContentView(history.get(history.size()-1));
			
		}else{
			finish();
		}
	}
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.income_statement);
          
        history = new ArrayList<View>();
        group = this;
        
        Activity.at.add(this);
        
      
    }
 
    public void onBackPressed(){
    	group.back();
    	return;
    }
  
   
}